package com.thread.pool.domain.dto;

/**
 * 线程池参数
 */
public class ThreadPoolDataDto {
    /**
     * 核心线程数
     */
    private Integer coreSize;

    /**
     * 最大线程数
     */
    private Integer maxSize;

    /**
     * 当前队列数
     */
    private Integer queueSize;

    /**
     * 剩余队列数
     */
    private Integer remainingCapacity;

    /**
     * 非核心线程闲置时超时 单位为秒
     */
    private Long keepAlive;

    /**
     * 拒绝策略
     */
    private String callerRunsPolicy;

    /**
     * 当前池中的线程数
     */
    private int poolSize;

    /**
     * 完成任务数
     */
    private long completedTaskCount;

    /**
     * 返回池中已存在的最大线程数
     */
    private int largestPoolSize;

    /**
     * 执行的总任务数(大致的数量，不会很精确)
     */
    private long taskCount;

    /**
     * 正在执行任务的线程的大致数目
     */
    private int activeCount;

    public Integer getCoreSize() {
        return coreSize;
    }

    public ThreadPoolDataDto setCoreSize(Integer coreSize) {
        this.coreSize = coreSize;
        return this;
    }

    public Integer getMaxSize() {
        return maxSize;
    }

    public ThreadPoolDataDto setMaxSize(Integer maxSize) {
        this.maxSize = maxSize;
        return this;
    }

    public Integer getQueueSize() {
        return queueSize;
    }

    public ThreadPoolDataDto setQueueSize(Integer queueSize) {
        this.queueSize = queueSize;
        return this;
    }

    public Long getKeepAlive() {
        return keepAlive;
    }

    public ThreadPoolDataDto setKeepAlive(Long keepAlive) {
        this.keepAlive = keepAlive;
        return this;
    }

    public String getCallerRunsPolicy() {
        return callerRunsPolicy;
    }

    public Integer getRemainingCapacity() {
        return remainingCapacity;
    }

    public ThreadPoolDataDto setRemainingCapacity(Integer remainingCapacity) {
        this.remainingCapacity = remainingCapacity;
        return this;
    }

    public ThreadPoolDataDto setCallerRunsPolicy(String callerRunsPolicy) {
        this.callerRunsPolicy = callerRunsPolicy;
        return this;
    }

    public int getPoolSize() {
        return poolSize;
    }

    public ThreadPoolDataDto setPoolSize(int poolSize) {
        this.poolSize = poolSize;
        return this;
    }

    public long getCompletedTaskCount() {
        return completedTaskCount;
    }

    public ThreadPoolDataDto setCompletedTaskCount(long completedTaskCount) {
        this.completedTaskCount = completedTaskCount;
        return this;
    }

    public int getLargestPoolSize() {
        return largestPoolSize;
    }

    public ThreadPoolDataDto setLargestPoolSize(int largestPoolSize) {
        this.largestPoolSize = largestPoolSize;
        return this;
    }

    public long getTaskCount() {
        return taskCount;
    }

    public ThreadPoolDataDto setTaskCount(long taskCount) {
        this.taskCount = taskCount;
        return this;
    }

    public int getActiveCount() {
        return activeCount;
    }

    public ThreadPoolDataDto setActiveCount(int activeCount) {
        this.activeCount = activeCount;
        return this;
    }

    public static ThreadPoolDataDto build(){
        return new ThreadPoolDataDto();
    }
}
